#ifndef IL_IMAGE_H
#define IL_IMAGE_H

#include <GL/gl.h>

#ifdef JMBC_INSIDE

typedef struct
{
	unsigned int width;
	unsigned int height;
	unsigned int bpp;
	unsigned char *pixels;
} ILImage;

ILImage *
ilImageStore(unsigned int id);

GLenum
ilImageBPPToFormat(unsigned int bpp);

unsigned int
ilImageFormatToBPP(GLenum format);

#endif

// Context

void
ilImageCreateContext(void);

// Generation / Deletion

void
ilGenImages(unsigned int n, unsigned int *images);

void
ilDeleteImages(unsigned int n, unsigned int *images);

// Load / Unload

#include "ilPNG.h"
#include "ilJPG.h"
#include "ilTGA.h"

void
ilImageLoad(unsigned int id, unsigned int filepath);

void
ilImageUnload(unsigned int id);

void
ilImagesUnload(unsigned int n, unsigned int *images);

// OpenGL Integration

void
ilImageCapture(unsigned int id, int x, int y, unsigned int width, unsigned int height, GLenum format);

void
ilImageBuild2DMipmaps(unsigned int id);

void
ilImageTexImage2D(unsigned int id);

#endif
